import Vue from 'vue'
import Vuex from 'vuex'
import axios from "../utils/requect"
import "../api/index"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list: []
  },
  getters: {

  },
  mutations: {
    getList(state, payload) {
      state.list = payload
    }
  },
  actions: {
    ActionGetlist(context) {
      axios.get("/api/list").then(res => {
        // state.list = res.data.list
        context.commit("getList", res.data.list)
      })
    }
  },
  modules: {}
})